﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Controls;

namespace ValidationRules
{
    class NotEmptyRule : ValidationRule
    {
        public override ValidationResult Validate(object value, System.Globalization.CultureInfo cultureInfo)
        {
            if (String.IsNullOrEmpty(value as string))
            {
                return new ValidationResult(false, "The field is required.");
            }
            else
            {
                return new ValidationResult(true, null);
            }
        }
    }
}
